home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / misc / emu / Apex-src.lha / GRAPHICS.DOC < prev    next >
Text File  |  2001-09-30  |  7KB  |  173 lines

  1. GRAPHICS.DOC    JAN-02-88
  2.  
  3.                XPL AMIGA GRAPHICS
  4.  
  5. 40. CLEAR
  6.  
  7. This intrinsic clears the currently defined bit-map by setting all pixels
  8. to zero. It is normally used to erase a bit-map before drawing on it or
  9. displaying it. (See 108. BITMAP.) 
  10.  
  11. The CLEAR intrinsic will appear to run as much as twice as fast if it is
  12. not immediately followed by a LINE or POINT intrinsic. The reason for
  13. this is that the blitter is used to clear memory, and it alternates
  14. cycles with the 68000, thus allowing the 68000 to run while memory is
  15. being cleared. LINE and POINT also use the blitter. So for example if
  16. LINE immediately follows CLEAR, the 68000 must spend its time waiting for
  17. the blitter to finish clearing before giving it the LINE command. The
  18. 68000 could be spending this time doing something useful. It takes
  19. approximately 1/90th of a second to clear a 640x400x1 bit-map.
  20.  
  21.  
  22. 41. POINT(X, Y, color)
  23.  
  24. This intrinsic draws a point on the current bit-map at the specified
  25. coordinate, X,Y. (See 108. BITMAP.)
  26.  
  27. "Color" simply specifies whether or not a pixel in a particular bit plane
  28. is set or cleared. If there is only one bit plane (DEPTH = 1) then color
  29. can be either 0 or 1; if there are two bit planes (DEPTH = 2) then color
  30. can be 0 through 3; etc. Here "color" is used to select a color register
  31. -- the actual color that is displayed is determined by the value in the
  32. color register (see 111. PALETTE).
  33.  
  34. Color bits 0 through 4 are used to specify up to 32 different color
  35. registers. Bits 5 through 7 are reserved for future color registers.
  36.  
  37. Bit 8 is used to specify complement mode. If this bit is set, the
  38. register select bits (0-7) and bit 9 are ignored. Instead, the color
  39. register is determined by complementing the value that is already drawn.
  40. For example, with a single bit plane a point that is 0 (the background
  41. color) will be changed to a 1. If this point is redrawn then it will be
  42. changed back to a 0. This provides a convenient way to "erase" a point by
  43. redrawing it. The point will be restored to its original color, which
  44. could be part of a complex background pattern.
  45.  
  46. Bit 9 specifies "fast" mode. Assume you have four bit planes (DEPTH = 4)
  47. and you are drawing on a cleared bit-map. If you specify color = 8 then
  48. one pixel is set and three pixels are cleared. But these were already
  49. clear. By specifying color = $28, you save the time required to clear the
  50. pixels. Actually, the time savings is negligible when drawing points, but
  51. it is significant when drawing lines.
  52.  
  53.  
  54. 42. LINE(X, Y, color)
  55.  
  56. This intrinsic draws a straight line on the current bit-map. The line is
  57. drawn from the previous coordinate to the coordinate X,Y. "Color" is the
  58. same as for POINT, however bits 16 through 31 are used to specify various
  59. patterns of dotted and dashed lines.
  60.  
  61. For example, this will draw a normal, solid line from 0,0 to 160,100:
  62.  
  63.     POINT(0, 0, 0);            \set the starting coordinate
  64.     LINE(160, 100, 1);        \draw a solid line
  65.  
  66. This will continue drawing the line from 160,100 to the upper-right
  67. corner, 319,0:
  68.  
  69.     LINE(319, 0, 1);
  70.  
  71. This draws a dotted line down to the lower-left corner:
  72.  
  73.     LINE(0, 200, $AAAA0001);
  74.  
  75.  
  76.  
  77. 43. MOVE(X, Y)
  78.  
  79. This intrinsic is used to move to the beginning of a line.
  80.  
  81.  
  82. 108. BITMAP(address, width, height, depth)
  83.  
  84. This intrinsic defines the location in memory to be used for a bit-
  85. mapped graphics display. The dimensions are specified in pixels. To set
  86. up a typical low-resolution display using two bit planes (four colors),
  87. do the following:
  88.  
  89.     def    WIDTH= 320, HEIGHT= 200, DEPTH= 2;
  90.     begin
  91.     RASTER:= RESERVE(WIDTH /8 *HEIGHT *DEPTH);
  92.     BITMAP(RASTER, WIDTH, HEIGHT, DEPTH);
  93.     \ . . .
  94.  
  95.  
  96. 109.
  97. BITMAP2(magnificationX, magnificationY, offsetX, offsetY, invertX, invertY)
  98.  
  99. This intrinsic changes the way points and lines are plotted on the bit-
  100. map. "Magnification" is used to enlarge or diminish coordinates along the
  101. X or Y axes. The specified magnification is actually a power of two. For
  102. example, if magnificationX = 1 then the X coordinate is doubled before it
  103. is plotted. If magnificationX = 2 then the X coordinate is multiplied by
  104. four. If magnificationY = -3 then the Y coordinate is divided by eight.
  105. The default magnification is 0, which causes no change in size.
  106.  
  107. "Offset" is the amount that is added to a coordinate before it is
  108. plotted. Normally the upper-left corner is the coordinate 0,0, but
  109. sometimes it is convenient to use the center of the screen as the origin.
  110. In this case, for a low resolution display, the X and Y offsets would be
  111. 160 and 100. Any offset can be specified. If a portion of your image is
  112. outside the limits of the bit-map, it is automatically clipped. The
  113. default offset is 0.
  114.  
  115. "Invert" is a boolean which is used to invert the direction of an axis.
  116. For example, if you prefer to think of the Y axis as increasing from
  117. bottom to top, set invertY = true. The default X direction is from left
  118. to right (invertX = false). The default Y direction is from bottom to top
  119. (invertY = false).
  120.  
  121.  
  122. 110. VIEW(address, BPLCON0)
  123.  
  124. This intrinsic is used to control the way a bit-map is displayed. Since
  125. there can be more than one bit-map, the address is used to select which
  126. one is to be displayed. The address can also specify which portion to
  127. display if the bit-map is larger than the screen.
  128.  
  129. BPLCON0 is the value that is written into the Amiga's graphics control
  130. register ($DFF100). The individual bits are defined as follows:
  131.  
  132.     15 HIRES    High resolution mode (WIDTH = 640)
  133.     14 BPU2        Bit plane use code (DEPTH = 0 through 6)
  134.     13 BPU1        "   "     "   "    "          "       "
  135.     12 BPU0        "   "     "   "    "          "       "
  136.  
  137.     11 HAM        Hold and modify mode (HIRES=0, BPU=5 or =6)
  138.     10 DBLPF    Double playfield (PF1=odd, PF2=even bit planes)
  139.      9 COLOR    Composit video color enable (no effect on RGB)
  140.      8 GAUD        Genlock audio enable
  141.  
  142.      7 --        Not used
  143.      6 --        "   "
  144.      5 --        "   "
  145.      4 --        "   "
  146.  
  147.      3 LPEN        Light pen enable (reset on power-up)
  148.      2 LACE        Interlace enable (HEIGHT = 400)
  149.      1 ERSY        External resync
  150.      0 --        Not used
  151.  
  152. This is how you would display the RASTER bit-map defined above
  153. (320 x 200 x 2):
  154.  
  155.     VIEW(RASTER, $2000);
  156.  
  157.  
  158. 111. PALETTE(register, value)
  159.  
  160. This intrinsic is used to set the value of a color register. "Register"
  161. is 0 through 31. "Value" is a 12-bit integer consisting of four bits of
  162. red, green, and blue. For example:
  163.  
  164.     Black    $000            Gray    $888
  165.     Red    $F00            Orange    $F90
  166.     Green    $0F0            Yellow    $FF0
  167.     Blue    $00F            Purple    $91F
  168.     White    $FFF            Brown    $C80
  169.  
  170. ck    $000            Gray    $888
  171.     Red    $F00            Orange    $F90
  172.     Green    $0F0            Yellow    $FF0
  173.     Blue    $00